package com.wson.configuration.clouddisk;

import com.wson.configuration.IConfigurationExecutor;
import com.wson.configuration.impl.PlatformMetaConfigurationExecutor;
import com.wson.configuration.impl.XmlConfigurationExecutor;
import com.wson.configuration.sterotype.AbstractConfigurationExecutor;
import com.wson.model.clouddisk.factory.ModelFactory;

public class CodiskConfigurationExecutor extends AbstractConfigurationExecutor
		implements IConfigurationExecutor {

	@Override
	public void execute() throws Exception {
		
		System.out.println("----------"+getConfigurationPathSync()+" Configuration Start!-----------");
		/*
		ISchemaExecutor schemaexec = BeanFactory.getCurrentFactory().getDaoFactory().getSchemaExecutor();
		if(schemaexec!=null)
			schemaexec.execute(BeanFactory.getCurrentFactory().getProtonFactory().getProtons());		

		*/
		
		super.executeRelated();
		
		PlatformMetaConfigurationExecutor metaexecutor = new PlatformMetaConfigurationExecutor();
		metaexecutor.execute(ModelFactory.getLocalModels());
		
		XmlConfigurationExecutor executor=new XmlConfigurationExecutor();
		
		executor.setXmlPath(this.generateConfigurationStorePath());
		executor.setXmlStartFile(DEFAULT_CONFIGURATIONFILE);		
		
		executor.execute();
		System.out.println("----------"+getConfigurationPathSync()+" Configuration Finished!-----------");
	}

	@Override
	protected String getConfigurationPathSync() {
		return "clouddisk";
	}

	@Override
	protected Integer getApplicationSerial() {
		return 32;
	}

}
